package com.example.another.bottomnavigationdemo1;

import android.content.Intent;
import android.support.annotation.Nullable;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private Button mButton1, mButton2, mButton3, mButton4, mButton5;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initViews();
    }

    private void initViews() {
        mButton1 = (Button) findViewById(R.id.button1);
        mButton2 = (Button) findViewById(R.id.button2);
        mButton3 = (Button) findViewById(R.id.button3);
        mButton4 = (Button) findViewById(R.id.button4);
        mButton5 = (Button) findViewById(R.id.button5);

        mButton1.setOnClickListener(this);
        mButton2.setOnClickListener(this);
        mButton3.setOnClickListener(this);
        mButton4.setOnClickListener(this);
        mButton5.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.button1:
                startActivity(new Intent(MainActivity.this, FirstActivity.class));
                break;
            case R.id.button2:
                startActivity(new Intent(MainActivity.this, SecondActivity.class));
                break;
            case R.id.button3:
                startActivity(new Intent(MainActivity.this, ThirdActivity.class));
                break;
            case R.id.button4:
                startActivity(new Intent(MainActivity.this, ForthActivity.class));
                break;
            case R.id.button5:
                startActivity(new Intent(MainActivity.this, FiveActivity.class));
                break;
            default:
                break;
        }
    }
}
